<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:a4j="http://richfaces.org/a4j"
	template="/layout/contentLayout.xhtml">

	<ui:param name="param_navigationUrl"
		value="/luyuan/promotion/navigationPromotion.jsf" />

	<ui:define name="road">
		<span><h:outputLink value="">促销活动</h:outputLink> </span>
	</ui:define>

	<!-- content -->
	<ui:define name="content">
		<h:form id="productForm">
			<rg:areaPanel>
				<rg:areaPanel type="searchPanel" style="margin-top: 10px;">
					<rg:fieldSet column="auto" labelWidth="80px">
						<rg:inputText id="name" label="活动主题"
							value="#{promotionAction.criteria.theme}" />
						<rg:calendar id="date" label="当前活动"
							value="#{promotionAction.criteria.startDate}" />
						<rg:field>
							<h:commandButton styleClass="button" value="搜索" />
						</rg:field>
					</rg:fieldSet>
				</rg:areaPanel>
				<rg:titlePanel headerTitle="活动列表" style="margin-top: 10px;"
					needButton="true" readonly="false">
					<ui:define name="headerActions">
						<h:outputLink value="addPromotion.jsf">新增</h:outputLink>
					</ui:define>
					<rg:table tableId="promotionTable"
						value="#{promotionAction.tableModel}" var="item">
						<rg:column property="theme" title="活动主题" width="100" />
						<rg:column property="startDate" title="开始时间" converter="#{dateConverter}" datePattern="yyyy-MM-dd"/>
						<rg:column property="endDate" title="结束时间" converter="#{dateConverter}" datePattern="yyyy-MM-dd" />
						<rg:column title="操作">
							<ul class="links">
								<li><h:outputLink
										value="updatePromotion.jsf?uuid=#{item.id}">修改</h:outputLink>
								</li>
								<li><h:commandLink
										actionListener="#{promotionAction.removePromotion(item.id)}"
										value="删除" />
								</li>
							</ul>
						</rg:column>
					</rg:table>
				</rg:titlePanel>
			</rg:areaPanel>
		</h:form>
		<a:form>
			<a:jsFunction name="reRenderPromotionTable" reRender="promotionTable" />
		</a:form>
	</ui:define>
</ui:composition>